package com.graduation.vaccine.controller;


import com.graduation.vaccine.service.ProductionService;
import com.graduation.vaccine.vo.RespBean;
import com.graduation.vaccine.vo.VaccineVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ZhaoJunYao
 * @since 2022-04-12
 */
@Controller
@RequestMapping("/production")
@Api(tags = "疫苗模块")
public class ProductionController {

    @Autowired
    private ProductionService productionService;

    @GetMapping("/all")
    @ApiOperation("获取所有疫苗")
    @ResponseBody
    public RespBean getAll(){
       return productionService.getAll();
    }

//    @PostMapping("/updateById")
//    @ApiOperation("根据id修改疫苗信息")
//    @ResponseBody
//    public RespBean updateProductById(@Valid @RequestBody Production production){
//        return productionService.updateProductById(production);
//    }

    @PostMapping("/info")
    @ApiOperation("疫苗详情页获取数据")
    @ResponseBody
    public RespBean getInfoByProductionIdAndDepartmentcode(@RequestBody VaccineVo vaccineVo){
        return productionService.getInfoByProductionIdAndDepartmentcode(vaccineVo);
    }

    @PostMapping("/list")
    @ApiOperation("根据catalog获取疫苗列表")
    @ResponseBody
    public RespBean getListByCatalogId(@RequestBody String catalogId){
        return productionService.getListByCatalogId(catalogId);
    }



}
